<template>
  <div class="top_con">
    <div class="top_title">
      <div class="top_t_type">
        <div class="left_t_main">课程分类</div>
        <div class="top_item1" v-for="(item,index) in titleList" :key="item.id">
          <i v-if="index<2"></i>
          {{item.name}}
        </div>
       
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      titleList: []
    };
  },
  created() {
    this.$http.get("http://47.92.50.43:8889/sys/menu").then(res => {
      console.log(res.data);

      this.titleList = res.data;
    });
  }
};
</script>
 
<style>
.left_t_main {
  width: 200px;
  height: 60px;
  background: #2181f0;
  color: #fff;
  font-size: 22px;
  line-height: 60px;
  position: relative;
  top: -20px;
  left: 10px;
}
.top_t_type i {
  width: 24px;
  height: 18px;
  background: url("../assets/image/icon.png") no-repeat;
  background-position: -149px 0;
  position: absolute;
  top: 0;
  left: 65px;
}
.top_con {
  width: 100%;
  background: #f5f5f5;
}
.top_title {
  width: 1200px;
  margin: 0 auto;
  position: relative;
}
.top_title > .top_t_type {
  width: 100%;
  height: 40px;
  display: flex;
  line-height: 40px;
  background: #f5f5f5;
  position: relative;
}
.top_title > .top_t_type > div {
  margin: 0 20px;
  position: relative;
}
</style>